program on Type 3 driver or thin driver.
import java.sql.*;
public class Insert
{
public static void main(String args[])
{
Connection con=null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection
("jdbc:oracle:oci8 @localhost:1521:orcl”,”scott”,”tiger”);
Statement st=con.createStatement();
St.executeUpdate(“insert into abc values(100,’prasad’,5600)”);
System.out.println("Row Inserted");
}
catch(ClassNotFoundException e)
{
e.printStackTrace();
}
catch(SQLException e)
{
e.printStackTrace();
}
finally
{
try
{
if(con!=null)
con.close();
}
catch(SQLException e)
{
e.printStackTrace();
}
}
}
}